/*
 * AnnotateTokenPanel.java
 *
 * Created on 13 July 2006, 21:57
 */

package andyr.jtokeniser.gui;

/**
 *
 * @author  Andy
 */
public class AnnotateTokenPanel extends javax.swing.JPanel {
    
    /** Creates new form AnnotateTokenPanel */
    public AnnotateTokenPanel() {
        initComponents();
    }
    
    public String getPrefix() {
        
        String prefix = txtPrefix.getText();
        prefix = prefix.replace("\\n", "\n");
        prefix = prefix.replace("\\r", "\r");
        prefix = prefix.replace("\\t", "\t");
        prefix = prefix.replace("\\f", "\f");
        return prefix;
    }
    
    public String getSuffix() {
        String suffix = txtSuffix.getText();
        suffix = suffix.replace("\\n", "\n");
        suffix = suffix.replace("\\r", "\r");
        suffix = suffix.replace("\\t", "\t");
        suffix = suffix.replace("\\f", "\f");
        return suffix;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        lblPrefix = new javax.swing.JLabel();
        txtPrefix = new javax.swing.JTextField();
        lblSuffix = new javax.swing.JLabel();
        txtSuffix = new javax.swing.JTextField();

        lblPrefix.setText("Token prefix");

        txtPrefix.setText("[");

        lblSuffix.setText("Token suffix");

        txtSuffix.setText("] ");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(lblPrefix)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(txtPrefix, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE))
                    .add(layout.createSequentialGroup()
                        .add(lblSuffix)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(txtSuffix, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lblPrefix)
                    .add(txtPrefix, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lblSuffix)
                    .add(txtSuffix, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(245, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lblPrefix;
    private javax.swing.JLabel lblSuffix;
    private javax.swing.JTextField txtPrefix;
    private javax.swing.JTextField txtSuffix;
    // End of variables declaration//GEN-END:variables
    
}
